<?php echo $header; ?>
<div class="container make-bg">
<?php echo $content_tg_user; ?>
<?php echo $content_top; ?>
<div class="row-fluid">
<?php echo $content_bottom; ?>
</div>
<!-- Start Tab & Deal -->
<div class="services">
	<div class="row-fluid">
		<div class="span7">
            <ul id="wdtTab" class="nav nav-tabs">
              <li class="active"><a href="#new-arrival" data-toggle="tab">New Arrival</a></li>
              <li><a href="#best-sellers" data-toggle="tab">Best Sellers</a></li>
              <li> <a href="#specials" data-toggle="tab">Daily Specials</a></li>
            </ul>
            <div id="wdtTabContent" class="tab-content">
				<div class="tab-pane fade in active" id="new-arrival">
					<div class="row-fluid">
						<?php foreach($products_lastest as $row){ ?>
						<div class="span3">
							<div class="wdt-product">
                                    <div class="wdt-products-wrapper">
                                        <div class="wdt-product active show">
                                            <a href="<?php echo $row['href'] ?>" title="<?php echo $row['name'] ?>">
                                                <img src="<?php echo $row['thumb'] ?>" alt="<?php echo $row['name'] ?>" />
                                            </a>
                                            <h4><a href="<?php echo $row['href'] ?>" title="<?php echo $row['name'] ?>"><?php echo $row['name'] ?></a></h4>
                                            <div class="wdt-overlay zoom-hover" onclick="document.location.href='<?php echo $row['href'] ?>'"><span class="amount zoom"><i class="icon-link"></i></span></div>
                                            <ul class="rating">
                                                <?php for($i=1;$i<=5;$i++){ ?>
	                                                <?php if($i<=(int)$row['rating']){ ?>
	                                                <li><i class="star-on"></i></li>
	                                                <?php } else{ ?>
                                                	<li><i class="star-off"></i></li>
	                                                <?php } ?>
                                                <?php } ?>
                                            </ul>
                                                <div class="wdt-pricing">
                                                    <a href="<?php echo $row['href'] ?>" title="<?php echo $row['name'] ?>"><span class="amount"><?php echo $row['price'] ?></span></a>
                                                </div>
                                        </div>
                                    </div>
                                </div>
						</div>
						<?php } ?>
					</div>
              </div>
              
				<div class="tab-pane fade" id="best-sellers">
					<div class="row-fluid">
						<?php foreach($products_bestseller as $row){ ?>
						<div class="span3">
							<div class="wdt-product">
                                    <div class="wdt-products-wrapper">
                                        <div class="wdt-product active show">
                                            <a href="<?php echo $row['href'] ?>" title="<?php echo $row['name'] ?>">
                                                <img src="<?php echo $row['thumb'] ?>" alt="<?php echo $row['name'] ?>" />
                                            </a>
                                            <h4><a href="<?php echo $row['href'] ?>" title="<?php echo $row['name'] ?>"><?php echo $row['name'] ?></a></h4>
                                            <div class="wdt-overlay zoom-hover" onclick="document.location.href='<?php echo $row['href'] ?>'"><span class="amount zoom"><i class="icon-link"></i></span></div>
                                            <ul class="rating">
                                                <?php for($i=1;$i<=5;$i++){ ?>
	                                                <?php if($i<=(int)$row['rating']){ ?>
	                                                <li><i class="star-on"></i></li>
	                                                <?php } else{ ?>
                                                	<li><i class="star-off"></i></li>
	                                                <?php } ?>
                                                <?php } ?>
                                            </ul>
                                                <div class="wdt-pricing">
                                                    <a href="<?php echo $row['href'] ?>" title="<?php echo $row['name'] ?>"><span class="amount"><?php echo $row['price'] ?></span></a>
                                                </div>
                                        </div>
                                    </div>
                                </div>
						</div>
						<?php } ?>
					</div>
              </div>
              
				<div class="tab-pane fade" id="specials">
					<div class="row-fluid">
						<?php foreach($products_special as $row){ ?>
						<div class="span3">
							<div class="wdt-product">
                                    <div class="wdt-products-wrapper">
                                        <div class="wdt-product active show">
                                            <a href="<?php echo $row['href'] ?>" title="<?php echo $row['name'] ?>">
                                                <img src="<?php echo $row['thumb'] ?>" alt="<?php echo $row['name'] ?>" />
                                            </a>
                                            <h4><a href="<?php echo $row['href'] ?>" title="<?php echo $row['name'] ?>"><?php echo $row['name'] ?></a></h4>
                                            <div class="wdt-overlay zoom-hover" onclick="document.location.href='<?php echo $row['href'] ?>'"><span class="amount zoom"><i class="icon-link"></i></span></div>
                                            <ul class="rating">
                                                <?php for($i=1;$i<=5;$i++){ ?>
	                                                <?php if($i<=(int)$row['rating']){ ?>
	                                                <li><i class="star-on"></i></li>
	                                                <?php } else{ ?>
                                                	<li><i class="star-off"></i></li>
	                                                <?php } ?>
                                                <?php } ?>
                                            </ul>
                                                <div class="wdt-pricing">
                                                    <a href="<?php echo $row['href'] ?>" title="<?php echo $row['name'] ?>"><span class="amount"><?php echo $row['price'] ?></span></a>
                                                </div>
                                        </div>
                                    </div>
                                </div>
						</div>
						<?php } ?>
					</div>
              </div>
		</div>
	</div>

	<div class="span5">
		<h2 class="widget-title"><span>Special offer of the week</span></h2>
		<div class="sidebar-line"><span></span></div>
			<div id="home-deal" class="row-fluid">
                <div class="get-pad">
                    <div class="span9 home-deal-wrapper">
						<img src="catalog/view/theme/bistro/demo-images/01_deal-home.jpg" class="img-polaroid" alt="" />
						<a class="btn btn-general" href="#">APPLY NOW!</a>
						<p>Offering a wide selection of books on thousands of topics at low prices to satisfy any book-lover!</p>
                        <div class="deal-discount-block">
                            <span class="list-price-title">Value
                            <span class="price-num">$29.95</span></span>
                            <span class="list-price-title">Discount
                            <span class="price-num">23.2%</span></span>
                            <span class="list-price-title">Save<span class="price-num">$6.95</span></span>
                        </div>
					</div>
                <div class="span3">
					<div class="Counter">
						<ul id="countdown">
							<li><span class="days">00</span><p class="timeRefDays">days</p></li>
							<li><span class="hours">00</span><p class="timeRefHours">hours</p></li>
							<li><span class="minutes">00</span><p class="timeRefMinutes">minutes</p></li>
							<li><span class="seconds">00</span><p class="timeRefSeconds">seconds</p></li>
						</ul>
					</div>			
				</div>
				</div>
			</div>
		</div>
    </div>   
</div> 
<!-- END Tab & Deal --> 
  <!-- Start Home Blog & Testimonials -->
	<div class="row-fluid home-blog-wrapper">
	<div class="span4">
		<h2 class="widget-title"><span>Happy Testimonials</span></h2>
		<div class="sidebar-line"><span></span></div>
			<div class="testimonials flexslider flex-direction-nav-on-top">
				<ul class="slides">
					<li>
						<img src="catalog/view/theme/bistro/demo-images/01_testimonial.jpg" class="img-circle" alt="" />
						<blockquote>
							<p>“Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante. Sed varius, ut nulla in massa.”</p>
							<small>John Doe</small>
						</blockquote>
					</li>
					<li>
						<blockquote>
						<img src="catalog/view/theme/bistro/demo-images/02_testimonial.jpg" class="img-circle" alt="" />
							<p>“Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.”</p>
							<small>John Doe</small>
						</blockquote>
					</li>
					<li>
						<blockquote>
						<img src="catalog/view/theme/bistro/demo-images/03_testimonial.jpg" class="img-circle" alt="" />
							<p>“Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.”</p>
							<small>John Doe</small>
						</blockquote>
					</li>
				</ul>
			</div>
		</div>
        
		<div class="span8">
            <h2 class="widget-title"><span>Recent Blog Posts</span></h2>
                <div class="sidebar-line">
                    <span></span>
                </div>
              <div class="recent-blog flexslider flex-direction-nav-on-top">
                <ul class="slides">
                <?php foreach($news as $key=>$row){ ?>
			      <?php if($key%3==0){ ?>
			      <li>
			      <?php } ?>
                    <div class="span4 home-blog">
						<div class="wdt-product">
							<div class="wdt-products-wrapper">
								<div class="wdt-product active show">
									<a href="<?php echo $row['href'] ?>" title="">
										<img src="<?php echo $row['thumb'] ?>" alt="" />
									</a>
									<h3 class="post-title"><a href="<?php echo $row['href'] ?>"><?php echo $row['name'] ?></a></h3>
									<p class="post-meta"><?php echo $row['date_added'] ?> // <?php echo $row['comments'] ?></p>
									<div class="wdt-overlay zoom-hover" onclick="document.location.href='<?php echo $row['href'] ?>'"><span class="amount zoom"><i class="icon-link"></i></span></div>
								</div>
							</div>
						</div>
					</div>
					<?php if($key%3==2){ ?>
			        </li>
			        <?php } ?>
			      <?php } ?>
			      <?php if(count($products)%3!=0){ ?>
			        </li>
			      <?php } ?>
                </ul>
              </div><!-- .recent-posts -->
			</div>
	</div>
	<!-- END Home Blog & Testimonials -->
    
	<!-- Start Services -->
	<div class="footer-links">
			<div class="row-fluid">
				<div class="span7">
                    <h2 class="widget-title"><span>Store Categories</span></h2>
						<div class="sidebar-line"><span></span></div>
                        	<div class="row-fluid store-categories">
                        		<?php foreach ($categories as $category) { ?> 
	                        		<div class="span3 bullet_arrow2">
	                                	<h4><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a></h4>
								          <?php if ($category['children']) { ?>
								          <ul>
								            <?php foreach ($category['children'] as $child) { ?>
								            <li><a title="Total <?php echo $child['total']; ?> Items on this category" data-placement="top" data-toggle="tooltip" href="<?php echo $child['href']; ?>"><?php echo $child['name']; ?></a></li>
								            <li>
								           <?php } ?>
								          </ul>
								         <?php } ?>
	                                </div>
							       <?php } ?>  
							<div class="span12" style="margin-left:0px;margin-top:10px">
								<h4>Popular Store Tag's</h4>
                                <div class="store-tags">
                                <?php foreach($categories_char as $row){ ?>
                                    <a title="Total <?php echo $row['total']; ?> Items on this category" data-placement="bottom" data-toggle="tooltip" href="<?php echo $row['href']; ?>"><?php echo $row['name']; ?></a>
                                <?php } ?>
                                </div>
                            </div>
						</div>
                            
				</div>
                    
				<div class="span5">
					<h2 class="widget-title"><span>STAY CONNECT</span></h2>
						<div class="sidebar-line"><span></span></div>
                        	<div class="row-fluid">
								<p>Get updates, discounts, and special offers to win free stuff and cash prizes!</p>
                        	<div class="span5">
								<ul class="footer-social">
                                	<li><i class="icon-facebook"></i></li>
                                	<li><i class="icon-twitter"></i></li>
                                	<li><i class="icon-google-plus"></i></li>
                                	<li><i class="icon-pinterest"></i></li>
                                	<li><i class="icon-xing"></i></li>
                                	<li><i class="icon-youtube"></i></li>
                                    <li><i class="icon-linkedin"></i></li>
                                    <li><i class="icon-flickr"></i></li>
                                    <li><i class="icon-rss"></i></li>
                                </ul>
							</div>
                            
                        	<div class="span6">
                                <div id="subscibe">
                                    <h5><i class="icon-envelope"></i> Subscribe to Mail List</h5>
										<form id="subscribe" target="_blank" method="post" action="#">
											<input type="text" placeholder="Email address">
											<input type="text" placeholder="Full name">
											<button class="btn btn-general" name="subscribe">Subscribe</button>
											<button class="btn btn-general" name="unsubscribe">Unsubscribe</button>
										</form>
								</div>
                            </div>
                       </div>
				</div><!-- .span4 -->
            
			</div><!-- .row -->
       </div>     

	<!-- End Services -->

    
  	<!-- Start Footer Callout -->
	<div class="callout-wrapper">
		<div class="jumbotron span10">
			<h2 class="jumbotron-heading">Super awesome eCommerce template!</h2>
			<p class="lead">Cras justo odio, dapibus ac facilisis in, egestas eget quam. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
		</div>
		<div class="span1">
			<i class="icon-download" style="color:#ffffff; font-size:110px;"></i>
		</div>
	</div>
	<!-- End Footer Callout -->  
</div>
<?php echo $footer; ?>